{extend name="../../admin/view/public/admin"}

{block name='content'}

<style type='text/css'>
    .ordertable {
        width: 100%;
        position: relative;
        margin-bottom: 10px
    }

    .ordertable tr td:first-child {
        text-align: right
    }

    .ordertable tr td {
        padding: 10px 5px 0;
        vertical-align: top
    }

    .ordertable1 tr td {
        text-align: right;
    }

    .ops .btn {
        padding: 5px 10px;
    }

    .order-container {
        display: -webkit-box;
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
    }

    .order-container-left {
        -webkit-box-flex: 1;
        -webkit-flex: 1;
        -ms-flex: 1;
        flex: 1;
    }

    .order-container-static {
        -webkit-box-flex: 1;
        -webkit-flex: 1;
        -ms-flex: 1;
        flex: 1;
        padding: 30px 50px 20px;
    }

    .font18 {
        font-size: 20px;
        font-weight: bold;;
    }

    .trbagpack span {
        margin: 0 10px;
        display: inline-block;
        vertical-align: middle;
    }

    .trbagpack span.address {
        width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    tfoot .price {
        float: right;
    }

    tfoot .price-inner {
        display: inline-block;
        vertical-align: middle;
        width: 100px;
        text-align: right;
    }

    .packbag-group {
        border: 1px solid #efefef;
    }

    .packbag {
        padding: 0 30px;
    }

    .packbag-title {
        line-height: 33px;
    }

    .packbag-group .packbag-list {
        padding: 20px 33px;
        border-bottom: 1px solid #efefef;
        display: flex;
        align-items: center;
    }

    .packbag-list .packbag-media {
        width: 100px;
    }

    .packbag-list .packbag-inner {
        border-left: 1px solid #efefef;
        -webkit-box-flex: 1;
        -webkit-flex: 1;
        -ms-flex: 1;
        flex: 1;
    }

    .packbag-goods-list {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
    }

    .packbag-goods {
        width: 25%;
        display: flex;
        display: -webkit-flex;
        margin: 10px 0 5px;
    }

    .packbag-goods-media {
        width: 52px;
        height: 52px;
        margin-right: 10px;
    }

    .packbag-goods-media img {
        width: 52px;
        height: 52px;
        border: 1px solid #efefef;
    }

    .packbag-goods-inner {
        flex: 1;
        -webkit-box-flex: 1;
        -webkit-flex: 1;
        -ms-flex: 1;
        flex: 1;
        overflow: hidden;
    }

    .packbag-goods-inner p {
        color: #999;
    }

    .packbag-goods-inner .title {
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .table .trorder td {
        border-right: 1px solid #efefef;
    }

    .table .trorder td:nth-of-type(1) {
        border: none;
    }

    .rr-label {
        width: 75px;
        padding: 5px;
        border: 1px solid #eee;
        border-radius: 4px;
        background: #44ABF7;
        color: #fff;
        text-align: center;
    }

    .rr-process {
        color: #44ABF7;
        cursor: pointer;

    }

    .rr-process .input-group {
        display: none;
    }

    .rr-process .input-group:first-of-type {
        display: block;
    }

    .rr-process .form-control {
        display: none;
    }

    .rr-process .input-group-btn .btn {
        background: none !important;
        border: none !important;
        color: #44ABF7 !important;
        outline: none !important;
    }

    .rr-process .input-group-btn .btn:active {
        border: none !important;
        box-shadow: none !important;
    }


    .full-info .text {
        overflow: hidden;
    }

    .full-info .flex {
        display: flex;
    }

    .full-info .flex .text {
        width: 200px;
    }

</style>

<div class="page-header">
    当前位置：<span class="text-primary">订单详情</span>
</div>
<div class="page-content">

    {if $item['status']!=-1}
    <div class="step-region">
        <ul class="ui-step {if $item['service_type'] == 1}ui-step-4{else}ui-step-2{/if}">
            <li {if 0 <=$item['status']}class="ui-step-done"{/if}>
            <div class="ui-step-number">1</div>
            <div class="ui-step-title">买家下单</div>
            <div class="ui-step-meta">{if 0<=$item['status']}{:date('Y-m-d',$item['createtime'])}<br/>{:date('H:i:s',$item['createtime'])}{/if}</div>
            </li>
            <li {if !empty($item['paytime'])}class="ui-step-done"{/if}>
            <div class="ui-step-number">2</div>
            <div class="ui-step-title">买家付款</div>
            <div class="ui-step-meta">
                {if 1<=$item['status']}
                {:date('Y-m-d',$item['paytime'])}<br/>
                {:date('H:i:s',$item['paytime'])}
                {/if}
            </div>
            </li>

            {if $item['service_type'] == 1}
                <li {if 2 <=$item['status'] || ($item['status']==1 && $item['sendtype'] > 0)}class="ui-step-done"{/if}>
                    <div class="ui-step-number">3</div>
                    <div class="ui-step-title">
                        {if !empty($item['data']['addressid'])}
                        商家发货
                        {else}
                        确认取货
                        {/if}
                    </div>

                    <div class="ui-step-meta">
                        {if 2<=$item['status'] && !empty($item['data']['sendtime']) }
                            {:date('Y-m-d',$item['sendtime'])}<br/>{:date('H:i:s',$item['sendtime'])}
                        {else}
                            {if 2<=$item['status'] && !empty($item['finishtime'])}
                                {:date('Y-m-d',$item['finishtime'])}<br/>{:date('H:i:s',$item['finishtime'])}
                            {/if}
                        {/if}
                    </div>
                </li>
                <li {if 3<=$item['status']}class="ui-step-done"{/if}>
                    <div class="ui-step-number">4</div>
                    <div class="ui-step-title">订单完成</div>
                    <div class="ui-step-meta">{if 3<=$item['status']}{:date('Y-m-d',$item['finishtime'])}<br/>{:date('H:i:s',$item['finishtime'])}{/if}</div>
                </li>
            {/if}

        </ul>
    </div>
    {/if}

<form class="form-horizontal form" action="" method="post">
    <input type="hidden" name="id" value="{$item['id']}"/>
    <input type="hidden" name="dispatchid" value="{$dispatch['id']}"/>

    <!--<h3 class="order-title">订单信息</h3>-->

    <div class="row order-container">
        <div class="order-container-left" style="border-right: 1px solid #efefef">
            <div class="row">
                <div class="col-md-12">
                    <ul class="">
                        <li class="text"><span class="col-sm">订单编号：</span><span class="text-default">{$item['ordersn']}</span></li>
                        {if !empty($item['transid'])}
                        <li class="text"><span class="col-sm">平台单号：</span><span class="text-default">{$item['transid']}</span></li>
                        {/if}

                        {if !empty($coupon)}
                        <li class="text">
                            <span class="col-sm">优惠券：</span>
                            <span class="text-default"><a href="{:webUrl('web.sale.coupon/edit',array('id'=>$coupon['id']))}" target='_blank'>{$coupon['couponname']}</a> &nbsp;&nbsp;
                                <a data-toggle='popover' data-html='true' data-placement='right' data-content="
                                <table style='width:100%;'>
                                    <tr>
                                        <td style='border:none;text-align:right;'>优惠方式：</td>
                                        <td style='border:none;text-align:right;'>

                                            {if $coupon['backtype']==0}
                                                立减 {$coupon['deduct']} 元
                                            {elseif $coupon['backtype']==1}
                                                打 {$coupon['discount']} 折
                                            {elseif $coupon['backtype']==2}
                                                {if $coupon['backmoney']>0}返 {$coupon['backmoney']} 余额{/if}
                                                {if $coupon['backcredit']>0}返 {$coupon['backcredit']} 积分{/if}
                                                {if $coupon['backredpack']>0}返 {$coupon['backredpack']} 红包{/if}
                                            {/if}

                                        </td>
                                    </tr>

                                    {if $coupon['backtype']==2}
                                        <tr>
                                            <td style='border:none;text-align:right;'>返利方式：</td>
                                            <td style='border:none;text-align:right;'>
                                            {if $item['backwhen']==0}
                                                交易完成后(过退款期限)
                                            {elseif $item['backwhen']==1}
                                                订单完成后(收货后)
                                            {else}
                                                订单付款后
                                            {/if}
                                            </td>
                                        </tr>

                                        <tr>
                                            <td style='border:none;text-align:right;'>返利情况：</td>
                                            <td style='border:none;text-align:right;'>
                                            {if empty($coupon['back'])}
                                                未返利
                                            {else}
                                                已返利
                                            {/if}
                                            </td>
                                        </tr>

                                        {if !empty($coupon['back'])}
                                        <tr>
                                            <td style='border:none;text-align:right;'>返利时间：</td>
                                            <td style='border:none;text-align:right;'>{:date('Y-m-d H:i',$coupon['backtime'])}</td>
                                        </tr>
                                        {/if}
                                    {/if}

                                </table>">
                                    <i class='fa fa-question-circle'></i>
                                </a>
                            </span>
                        </li>
                        {/if}

                        <li class="text">
                            <span class="col-sm">付款方式：</span>
                            <span class="text-default">
                                {if $item['paytype'] == 0}未支付{/if}
                                {if $item['paytype'] == 1}微信支付{/if}
                                {if $item['paytype'] == 2}支付宝支付{/if}
                                {if $item['paytype'] == 3}余额支付{/if}
                                {if $item['paytype'] == 4}后台支付{/if}
                            </span>
                        </li>

                        <li class="text">
                            <span class="col-sm">买家：</span>
                            <span class="text-default">
                                <a href="{:webUrl('web.member/edit',array('id'=>$member['id']))}" target='_blank' class="text-primary">{$member['nickname']}</a> &nbsp;&nbsp;<a data-toggle='popover' data-html='true' data-trigger='hover' data-placement='right'
                                                                                                                                                                                           data-content="<table style='width:100%;'>
                <tr>
                    <td  style='border:none;text-align:right;' colspan='2'><img src='{$member['avatar']}' style='width:100px;height:100px;padding:1px;border:1px solid #ccc'  onerror='this.src='../addons/ewei_shopv2/static/images/noface.png''/></td>
                </tr>
                <tr>
                    <td  style='border:none;text-align:right;'>ID：</td>
                    <td  style='border:none;text-align:right;'>{$member['id']}</td>
                </tr>
                <tr>
                    <td  style='border:none;text-align:right;'>昵称</td>
                    <td  style='border:none;text-align:right;'>
                    {if empty($member['nickname'])}未填写{else} {$member['nickname']}{/if}

                    </td>
                </tr>
                <tr>
                    <td  style='border:none;text-align:right;'>姓名：</td>
                    <td  style='border:none;text-align:right;'>
                     {if empty($member['realname'])}未填写{else}{$member['realname']}{/if}
                    </td>
                </tr>
                <tr>
                    <td  style='border:none;text-align:right;'>手机号：</td>

                    <td  style='border:none;text-align:right;'> {if empty($member['mobile'])}未填写{else}{$member['mobile']}{/if}</td>
                </tr>
                <tr>
                    <td  style='border:none;text-align:right;'>微信号：</td>
                    <td  style='border:none;text-align:right;'>{if empty($member['weixin'])}未填写{else}{$member['weixin']}{/if}</td>
                </tr>
                </table>
"><i class='icow icow-help' style="font-size: 13px;color: #2f3434;margin-left: -3px"></i></a>
                            </span>
                        </li>
                        {if !empty($item['invoicename'])}
                        {php $invoice_info = m('sale')->parseInvoiceInfo($item['invoicename'])}

                        {if $invoice_info['title']}
                        <li class="text">
                            <span class="col-sm">发票类型：</span>
                            <span class="text-default">{$invoice_info['entity']?'纸质':'电子'}</span>
                            {if $invoice_info['title'] && $invoice_info['entity'] === false && $item['status']>0}
                            <a class="{if $item['invoice_img']}text-success{else}text-danger{/if}"
                               href="{:webUrl('order.op.upload_invoice',array('order_id'=>$item['id']));}"
                               data-toggle="ajaxModal"> {if $item['invoice_img']}查看已上传的电子发票{else}需要上传电子发票{/if}</a>
                            {/if}
                        </li>
                        <li class="text">
                            <span class="col-sm">抬头类型：</span>
                            <span class="text-default">{$invoice_info['company']?'单位':'个人'}</span>
                        </li>
                        {/if}
                        <li class="text">
                            <span class="col-sm">发票抬头：</span>
                            <span class="text-default">
                                    {if $invoice_info['title']}
                                    {$invoice_info['title']}
                                    {else}{$item['invoicename']}{/if}</span>
                        </li>
                        {if $invoice_info['company']}
                        <li class="text">
                            <span class="col-sm">纳税号：</span>
                            <span class="text-default">{$invoice_info['number']}</span>
                        </li>
                        {/if}
                        {/if}

                        {if $item['service_type'] == 1}
                            <li class="text">
                                <span class="col-sm">配送方式：</span>
                                <span class="text-default">
                                    {if $item['isverify'] == 1}
                                        {if $isonlyverifygoods}
                                        记次/时核销
                                        {else}
                                            线下核销
                                        {/if}
                                    {elseif !empty($item['addressid']) && $item['city_express_state']==0}
                                        快递
                                    {if !empty($dispatch['dispatchname'])}({$dispatch['dispatchname']}){/if}
                                    {elseif !empty($item['isvirtualsend']) || !empty($item['virtual'])}
                                        自动发货{if !empty($item['isvirtualsend'])}(虚拟物品){else}(虚拟卡密){/if}
                                    {elseif $item['dispatchtype']}
                                        自提
                                    {elseif $item['city_express_state']==1}
                                        同城配送
                                    {else}
                                        其他
                                    {/if}
                                </span>
                            </li>

                            {if !empty($item['data']['addressid'])}
                                <li class="text">
                                    <span class="col-sm">收货人：</span>
                                    <span class="text-default">
                                        {$user['address']}, {$user['realname']}, {$user['mobile']} <a class='text-primary op js-clip' data-url="{$user['address']}, {$user['realname']}, {$user['mobile']}">复制</a>
                                    </span>
                                </li>
                            {else}
                                <li class="text">
                                    <span class="col-sm">自提码：</span>
                                    <span class="text-default">{$item['verifycode']}</span>
                                </li>
                                <li class="text">
                                    <span class="col-sm">自提人：</span>
                                    <span class="text-default">{$user['carrier_realname']} {$user['carrier_mobile']} </span>
                                </li>
                                <li class="text">
                                    <span class="col-sm">门店名称：</span>
                                    <span class="text-default">{$user['storename']}</span>
                                </li>
                                <li class="text">
                                    <span class="col-sm">自提点：</span>
                                    <span class="text-default">{:html_entity_decode($user['address'])},  {$user['realname']}, {$user['mobile']}</span>
                                </li>
                            {/if}
                        {/if}


                        {if !empty($item['remark'])}
                            <li class="text"><span class="col-sm">买家备注：</span><span class="text-default">{$item['remark']}</span></li>
                        {/if}

                    </ul>
                </div>

                {if !empty($item['data']['addressid'])}
                    <div class="col-md-12 ops">
                        {if $item['merchid'] == 0}<a class="btn btn-primary" style="margin-left: 10px" data-toggle="ajaxModal" href="{:webUrl('web.order.op/changeaddress', array('id' => $item['id']))}">修改订单收货信息</a>{/if}
                    </div>
                {/if}

                {if !empty($order_data)}
                <div class="col-md-12 order-container-footer">
                    <span class="text" style="width: 85px;display: block"> 统一下单信息：</span>
                    {php $datas = $order_data}
                    {php $ii = 0;}
                    <div style="flex: 1;">
                        <table style="width: 100%;">
                            {loop $order_fields $key $value}

                            <tr {if $ii>1}class="diymore2" style="display:none;"{/if}>
                                <td style='width:60px'>{$value['tp_name']}：</td>
                                <td style="white-space: normal;">

                                </td>
                            </tr>

                            {if $ii==2}
                            <tr class="diymore22">
                                <td colspan="2"><a href="javascript:void(0);" style="padding-right: 100px;" id="showdiymore2">查看完整信息</a></td>
                            </tr>
                            {/if}

                            {php $ii++;}
                            {/loop}
                        </table>
                    </div>
                </div>
                {/if}
            </div>

        </div>

        <div class=" order-container-static">
            <div class=" status">
                <span class="text"> 订单状态：</span>

                {if $item['status'] == 0}
                    {if $item['service_type']==1}
                        <span class="text-warning font18">待发货</span>
                    {else}
                        <span class="text-danger font18">待付款</span>
                    {/if}
                {/if}

                {if $item['status'] == 1}
                    <span class="text-warning font18">
                        {if $item['service_type']==1}
                            {if $item['isverify'] == 1}
                                待使用
                            {elseif empty($item['addressid'])}
                                待取货
                            {else}
                                {if $item['sendtype'] > 0}部分发货{else}待发货{/if}
                            {/if}
                        {else}
                            已支付
                        {/if}
                    </span>
                {/if}

                {if $item['status'] == 2}<span class="text-warning font18">待收货</span>{/if}
                {if $item['status'] == 3}<span class="text-success font18">交易完成</span>{/if}

                {if $item['status'] == -1}
                    <span class="text-default font18">已关闭</span>
                    {if !empty($item['canceltime'])}
                    <span>(关闭时间:{:date('Y-m-d H:i:s',$item['canceltime'])})</span>
                    {/if}
                {/if}

                <i>
                    {if $item['status'] == 0}
                        （ 等待买家付款）
                    {/if}

                    {if $item['service_type']==1}
                        {if $item['status'] == 1 && $item['sendtype'] == 0}（买家已经付款，请商家尽快发货）{/if}
                        {if $item['status'] == 2 || ($item['status']==1 && $item['sendtype'] > 0)}（商家已发货，等待买家收货并交易完成）{/if}
                        {if $item['status'] == -1}
                            {if !empty($refund) && $refund['status']==1}
                            （ <span class="label label-default">已维权</span> {if !empty($refund['refundtime'])}维权时间: {:date('Y-m-d H:i:s',$refund['refundtime'])}{/if}）
                            {/if}
                        {/if}
                    {else}
                        {if $item['status'] == 1}（买家已经付款）{/if}
                    {/if}
                </i>
            </div>

            {if empty($order_goods)}
                {if !empty($item['expresssn']) && $item['status']>=2 && !empty($item['addressid'])}
                    <div>
                        <ul>
                            <li class="text">快递公司：<span class="text-default">{if empty($item['expresscom'])}其他快递{else}{$item['expresscom']}{/if}</span></li>
                            <li class="text">快递单号：<span class="text-default">{$item['expresssn']}</span>&nbsp;<a class="text-primary op" data-toggle="ajaxModal" href="{:webUrl('util/express', array('id' => $item['id'],'express'=>$item['express'],'expresssn'=>$item['expresssn'],'mobile'=>$user['mobile']))}">查看物流</a></li>
                            <li class="text">发货时间：<span class="text-default">{:date('Y-m-d H:i:s',$item['sendtime'])}</span></li>
                        </ul>
                    </div>
                {/if}
            {/if}

            <div class="ops  col-md-12" style="padding: 0;">
                {include file='web/order/index/ops'}

                {if $item['status'] ==0}
                    <a class='text-primary' data-toggle='ajaxModal' href="{:webUrl('web.order.op/changeprice',array('id'=>$item['id']))}">订单改价</a>
                {/if}

                <a class="text-primary" data-toggle="ajaxModal" href="{:webUrl('web.order.op/remarksaler', array('id' => $item['id']))}">
                    {if !empty($item['remarksaler'])}查看备注
                    {else}
                    添加备注
                    {/if}
                </a>

            </div>

            {if $item['status'] >0}
            <div class="order-container-footer text col-md-12" style="border: none;padding: 0">
                友情提示：
                {if $item['status'] == 0}
                {if $item['paytype']==3}
                订单为货到付款，请您务必联系买家确认后再进行发货
                {else}
                您可以联系买家进行付款，否则订单会根据设置自动关闭
                {/if}
                {/if}
                {if $item['status'] == 1}
                如果无法进行发货，请及时联系买家进行妥善处理;
                {/if}
                {if $item['status'] == 2}
                请及时关注物流状态，确保买家及时收到商品;
                如果买家未收到货物或有退换货请求，请及时联系买家妥善处理
                {/if}
                {if $item['status']==3}
                交易成功，如买家有售后申请，请与买家进行协商，妥善处理
                {/if}
            </div>
            {/if}
        </div>
    </div>

    {if !empty($order_goods)}
    <h3 class="order-title">包裹信息</h3>
    <div class="packbag-group">
        {loop $order_goods $index $og}
        <div class="packbag-list">
            <div class="packbag-media"><i class="icow icow-baoguo" style="display: inline-block;vertical-align: middle;font-size: 22px"></i>包裹{:chr($index+65)}</div>
            <div class="packbag-inner">
                <div class="packbag">
                    <div class="packbag-title">
                        <span style="margin-right: 90px">快递：{if empty($og['expresscom'])}其他快递{else}{$og['expresscom']}{/if}</span>
                        <span style="margin-right: 15px">快递单号：{$og['expresssn']}</span>
                        <span style="margin-right: 90px"><a class="text-primary op" data-toggle="ajaxModal" href="{:webUrl('util/express', array('id' => $og['id'],'express'=>$og['express'],'expresssn'=>$og['expresssn']))}">查看物流</a></span>
                        <span>发货时间：{:date('Y-m-d H:i:s', $og['sendtime'])}</span>
                    </div>
                    {loop $og['goods'] $i $goods}
                    <div class="packbag-goods-list">
                        <div class="packbag-goods">
                            <div class="packbag-goods-media">
                                <img src="{:tomedia($goods['thumb'])}" onerror="this.src='/app/admin/static/images/default-pic.jpg'"/>
                            </div>
                            <div class="packbag-goods-inner">
                                <p class="title">
                                    <a target="_blank" href="{:webUrl('goods/edit', array('id' => $goods['id']))}" title="查看" style="display: block;line-height: 22px;max-width: 250px;white-space: nowrap;
    overflow: hidden;text-overflow: ellipsis;">{$goods['title']}</a>
                                </p>
                                <p>&yen;{$goods['realprice']}</p>
                            </div>
                        </div>
                    </div>
                    {/loop}
                </div>
            </div>
        </div>
        {/loop}
    </div>
    {/if}

    <h3 class="order-title">商品信息</h3>
    <table class="table ">
        <thead>
        <tr class="trorder" style="background: #fff">
            <th class="" style="width: 75px;text-align: right;padding-right: 0">商品标题</th>
            <th style=""></th>
            {if $item['service_type'] == 1}
                <th style="padding-left: 20px">规格、编号、条码</th>
                <th style="text-align: center;width: 10%">数量</th>
            {/if}
            <th style="text-align: center;width: 10%">单价</th>
            <th style="text-align: center;width: 15%;">原价</th>
            <th style="text-align: center;width: 15%;">折扣后</th>
            <th style="text-align: center;width: 15%;">状态</th>
        </tr>
        </thead>
        <tbody>

        {foreach $item['goods'] as $i => $goods}
        <tr class="trorder" style="background: #fff">
            <td style="text-align: right;padding-right: 0">
                <img src="{:tomedia($goods['thumb'])}" style='width:52px;height:52px;border:1px solid #efefef; padding:1px;' onerror="this.src='/app/admin/static/images/default-pic.jpg'">
            </td>
            <td style="min-width: 300px">
                <a target="_blank" href="{:webUrl('web.goods.index/edit', array('id' => $goods['id']))}" title="查看" style="display: block;line-height: 22px;max-width: 250px;white-space: nowrap;
    overflow: hidden;text-overflow: ellipsis;">{$goods['title']}</a>
                {if !empty($goods['invoice'])}<label class='label label-danger'>支持开票</label>{/if}
                {if $goods['seckill_task']}
                    <span class="label label-danger">{$goods['seckill_task']['tag']}</span>
                    {if $goods['seckill_room']}<span class="label label-primary">{$goods['seckill_room']['tag']?:$goods['seckill_room']['title']}</span>{/if}
                    <br/>
                {/if}
                {if $category[$goods['pcate']]['name']}
                    <span class="text-error">[{$category[$goods['pcate']]['name']}] </span>{/if}{if $children[$goods['pcate']][$goods['ccate']][1]}
                    <span class="text-info">[{$children[$goods['pcate']][$goods['ccate']][1]}] </span>
                {/if}
            </td>
            {if $item['service_type'] == 1}
            <td style="padding: 10px 20px">
                <p style="white-space:normal;">
                    规格：{if !empty($goods['optionname'])}<span class="label label-primary" data-container="body" data-toggle="popover" data-placement="right" data-content="{$goods['optionname']}">{$goods['optionname']}</span>{else}无{/if}
                </p>
                <p>
                    编码：{if !empty($goods['goodssn'])}<span>{$goods['goodssn']}</span>{else}无{/if}
                </p>
                <p>
                    条码：{if !empty($goods['productsn'])}<span>{$goods['productsn']}</span> {else}无{/if}
                </p>
            </td>
            <td style="text-align: center">
                <p>{$goods['total']}个</p>
            </td>
            {/if}
            <td style="text-align: center">
                <p>￥{:number_format($goods['marketprice'],2)}</p>
            </td>

            {if $item['ispackage']}
                <td style="text-align: center">&yen;{:number_format($goods['marketprice'],2)}</td>
            {else}
                <td style="text-align: center">&yen;{$goods['orderprice']}</td>
                <td style="text-align: center">
                    &yen;{$goods['realprice']}
                </td>
            {/if}

            <td style="text-align: center">
                {if $goods['single_refundstate']}
                {if $goods['single_refundstate']==8}
                <span class="text-danger">已拒绝</span>
                {elseif $goods['single_refundstate']==9}
                <span class="text-danger">维权成功</span>
                {elseif $goods['single_refundstate']==1}
                <span class="text-danger">退款中</span>
                {elseif $goods['single_refundstate']==2}
                <span class="text-danger">退货中</span>
                {/if}
                {elseif $item['refundid'] > 0 && $refund['status'] != -2 && $refund['status'] != -1 }
                {if !empty($refund) && $refund['status']==1}
                <span class="label label-default">已维权</span>
                {else}
                <span class="text-danger">维权中</span>
                {/if}
                {else}
                {if $item['status'] == 1}
                已付款
                {elseif $item['status'] == 2}
                已发货
                {elseif $item['status'] == 3}
                已完成
                {elseif $item['status'] == -1}
                已取消
                {elseif $item['status'] == 0}
                未付款
                {/if}
                {/if}
            </td>
        </tr>
        {/foreach}
        </tbody>

        <tfoot style="padding-top: 20px">
        <tr class="trorder">
            <td colspan="2" style="padding-left: 20px">
            </td>
            <td colspan="{if $item['service_type'] == 1}6{else}4{/if}" style="padding-right: 60px">
                <div class="price">
                    <p><span class="price-inner">商品小计：</span><span style="font-weight: bold">￥{$item['oldprice']}</span></p>

                    {if $item['service_type'] == 1}
                    <p><span class="price-inner">运费：</span>￥{$item['olddispatchprice']}</p>
                    {/if}

                    {if !$item['ispackage']}
                    {if $item['taskdiscountprice']>0 }
                    <p><span class="price-inner">任务活动优惠：</span><span class="text-danger">-￥{$item['taskdiscountprice']}</span></p>
                    {/if}
                    {if $item['lotterydiscountprice']>0 }
                    <p><span class="price-inner">游戏活动优惠：</span><span class="text-danger">-￥{$item['lotterydiscountprice']}</span></p>
                    {/if}
                    {if $item['discountprice']>0 }
                    <p><span class="price-inner">会员折扣：</span><span class="text-danger">-￥{$item['discountprice']}</span></p>
                    {/if}
                    {if $item['deductprice']>0 }
                    <p><span class="price-inner">积分抵扣：</span><span class="text-danger">-￥{$item['deductprice']}</span></p>
                    {/if}
                    {if $item['deductcredit2']>0 }
                    <p><span class="price-inner">余额抵扣：</span><span class="text-danger">-￥{$item['deductcredit2']}</span></p>
                    {/if}
                    {if $item['deductenough']>0 }
                    <p><span class="price-inner">商城满额立减：</span><span class="text-danger">-￥{$item['deductenough']}</span></p>
                    {/if}
                    {if $item['couponprice']>0 }
                    <p><span class="price-inner">优惠券优惠：</span><span class="text-danger">-￥{$item['couponprice']}</span></p>
                    {/if}
                    {if $item['isdiscountprice']>0 }
                    <p><span class="price-inner">促销优惠：</span><span class="text-danger">-￥{$item['isdiscountprice']}</span></p>
                    {/if}
                    {if $item['buyagainprice']>0 }
                    <p><span class="price-inner">重复购买优惠：</span><span class="text-danger">-￥{$item['buyagainprice']}</span></p>
                    {/if}
                    {/if}

                    {if intval($item['changeprice'])!=0}
                    <p>
                        <span class="price-inner">卖家改价：</span>
                        <span style='{if 0<$item[' changeprice']}color:green{else}color:red{/if}'>{if 0<$item['changeprice']}+{else}-{/if}￥{:number_format(abs($item['changeprice']),2)}</span>
                    </p>
                    {/if}

                    {if intval($item['changedispatchprice'])!=0}
                    <p>
                        <span class="price-inner">卖家改运费：</span>
                        <span style='{if 0<$item[' changedispatchprice']}color:green{else}color:red{/if}'>{if 0<$item['changedispatchprice']}+{else}-{/if}￥{:abs($item['changedispatchprice'])}</span>
                    </p>
                    {/if}

                    <p><span class="price-inner">实付款：</span><span style="font-size: 14px;font-weight: bold;color: #e4393c">￥{$item['price']}</span></p>
                </div>
            </td>
        </tr>
        </tfoot>
    </table>

</form>

<script language='javascript'>
    $(function () {
        $("#showdiymore1").click(function () {
            $(".diymore1").show();
            $(".diymore11").hide();
        });

        $("#showdiymore2").click(function () {
            $(".diymore2").show();
            $(".diymore22").hide();
        });
    });

    function showDiyInfo(obj) {
        var data = $(obj).attr('data');
        var id = "diyinfo_" + data;
        var hide = $(obj).attr('hide');

        if (hide == '1') {
            $("#" + id).show();
            $(obj).text('点击收起');
        } else {
            $("#" + id).hide();
            $(obj).text('点击展开');
        }
        $(obj).attr('hide', hide == '1' ? '0' : '1');
    }
</script>

{/block}
